package cn.yunhe.controller.temp;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloSpringMvcController2 {

    //
    //@RequestMapping(value = "hello444.dojava",method = RequestMethod.GET)
    //@RequestMapping(value = "hello444",method = RequestMethod.GET)
    //@RequestMapping(value = "hello444",method = RequestMethod.POST)
    public ModelAndView helloSpringMvc(String mname,String mpwd){
        System.out.println("==mname=="+mname+"==mpwd=="+mpwd);

        //设置逻辑视图名,视图解析器根据改名字解析到具体的视图页面
        ModelAndView modelAndView=new ModelAndView("hello222");
        //添加模型数据,可以是任意的POJO对象
        modelAndView.addObject("msg2springMvc","你好,springMVC444");
        //设置逻辑视图名,视图解析器根据改名字解析到具体的视图页面
        //modelAndView.setViewName("hello222");
        return modelAndView;
    }
}
